<h1>Dispatch By Customer Report</h1>
<div class='form'>
	<?php $form = $this->beginWidget('CActiveForm',array()); ?>
		<?php echo $form->errorSummary($model); ?>
		<div class="row">
			<?php echo $form->label($model,'custno'); ?>
			<?php $this->widget('zii.widgets.jui.CJuiAutoComplete',array(
			   	'name'=>'customerSearch',			   	
			    'sourceUrl'=>'index.php?r=ajax/searchCustomer',			  
			    'options'=>array(
			        'minLength'=>'2',
			        'select'=>'js:function(event,ui){
			        	$("#customerSearch").val(ui.item.label);
			        	$("#DispatchReportForm_custno").val(ui.item.value); 
			        }'
			    ),
			    'htmlOptions'=>array(
			        'style'=>'height:20px;',
			        'id'=>'customerSearch'
			    ),
			));?>
			<?php echo $form->hiddenField($model,'custno'); ?>
			<?php echo $form->error($model,'custno'); ?>
		</div>
		<div class="row">
			<?php echo $form->label($model,'onlyOpenDispatch'); ?>
			<?php echo $form->checkBox($model,'onlyOpenDispatch'); ?>
			<?php echo $form->error($model,'onlyOpenDispatch'); ?>
		</div>
		<div class='row'>
			<?php echo $form->label($model,'startDate'); ?>
			<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
				'model'=>$model,
				'attribute'=>'startDate',
				'options'=>array(
					'showAnim'=>'fold',
					'dateFormat'=>'yy-mm-dd'
				),

			)); ?>
			<?php echo $form->error($model,'startDate'); ?>
		</div>
		<div class='row'>
			<?php echo $form->label($model,'endDate'); ?>
			<?php $this->widget('zii.widgets.jui.CJuiDatePicker',array(
				'model'=>$model,
				'attribute'=>'endDate',
				'options'=>array(
					'showAnim'=>'fold',
					'dateFormat'=>'yy-mm-dd'
				),

			)); ?>
			<?php echo $form->error($model,'endDate'); ?>
		</div>
		<div class='row_buttons'>
			<?php echo CHtml::submitButton('Submit'); ?>
		</div>
	<?php $this->endWidget(); ?>
</div>